// tsx 中通过emit给父组件传参
interface Props {
  userName?: string;
  userAge?: number;
}

const handleClick = (props: Props, ctx: any) => {
  ctx.emit("on-click", props.userName);
};

const tsxDom = (props: Props, ctx: any) => {
  return (
    <>
      <div>{props.userName}</div>
      <div>{props.userAge}</div>
      <button onClick={() => handleClick(props, ctx)}>点击</button>
    </>
  );
};

export default tsxDom;
